package com.kangye.learnstudent.controller;

import com.kangye.learnstudent.entity.QuestionBank;
import com.kangye.learnstudent.entity.StudentPaper;
import com.kangye.learnstudent.service.TypePaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: learndeduo
 * @description: 试卷类型请求接口
 * @author: 高天乐
 * @create: 2021-05-17 14:06
 **/
@RestController
@CrossOrigin
@RequestMapping("/typePaper")
public class TypePaperController {

    @Autowired
    private TypePaperService typePaperService;

    @RequestMapping("/PaperFindById")
    public List<QuestionBank> PaperFindById(Integer typeId){
        if (typeId.equals(typeId)){
            return typePaperService.PaperFindById(typeId);
        }
        else{
            System.out.println("这个科目还没有视频,敬请期待");
            return  null;
        }
    }

    @RequestMapping("/answerTime")
    public List<StudentPaper> answerTime(Integer spId){

        return typePaperService.answerTime(spId);
    }
}
